package com.hucheng.seckill.rabbitmq;

import com.alibaba.fastjson.JSONObject;
import com.hucheng.seckill.config.RabbitP2PConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 凉白开不加冰
 * @Version: 0.0.1V
 * @Date: 2019-07-01
 * @Description: 秒杀消息发送队列
 **/
@Component
public class SeckillSender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(JSONObject jsonObject) {
        amqpTemplate.convertAndSend(RabbitP2PConfig.SECKILL_QUEUE_NAME, jsonObject.toJSONString());
    }
}
